package com.ywk.miaohsa.dao;

import com.ywk.miaohsa.domain.MiaoshaUser;
import org.apache.ibatis.annotations.*;

@Mapper
public interface MiaoshaUserDao {

    @Select("select * from miaosha_user where id = #{id}")
    public MiaoshaUser getById(@Param("id")long id);

    @Insert("insert into miaosha_user(id,nickname,password,flag_id) values(#{id},#{id},#{password},#{flagId})")
    public int insert(MiaoshaUser miaoshaUser);

    @Update("update miaosha_user set id=#{id},nickname=#{nickname},address=#{address} where flag_id = #{flagId}")
    public int updateUserInfo(MiaoshaUser miaoshaUser);

    @Update("update miaosha_user set password=#{password} where flag_id=#{flagId} ")
    int modifyPsw(MiaoshaUser miaoshaUser);
}
